package mt;

import java.util.Scanner;

public class meituan_0319_Main_2 {
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int n=cin.nextInt();
        int t=cin.nextInt();
        StringBuffer sb=new StringBuffer();
        cin.nextLine();
        String s = cin.nextLine();
        if (t==1){
            //加密
            while (s.length()!=0){
                int index=0;
                if(s.length()%2!=0){
                    index=(s.length()+1)/2;
                }else {
                    index=s.length()/2;
                }
                sb.append(s.charAt(index-1));
                s=s.substring(0,index-1)+s.substring(index);
            }
            System.out.println(sb.toString());
        }else {
            //解密
            String res="";
            for (int i = s.length()-1; i >= 0; i--) {
                res=res.substring(0,res.length()/2)+s.charAt(i)+res.substring(res.length()/2);
            }
            System.out.println(res);
        }
    }
}
